package bus

import (
	"git.oschina.net/antlinker/antevent/server/app"
	"git.oschina.net/antlinker/antevent/server/store"
)

// Analysis 事件分析
type Analysis interface {
	// 查询事件
	QueryEvent(etype, action, from string, page int, count int) (result app.AntEventHistoryList, err error)
	// 查询事件监听执行情况
	QueryHook(eid string) (result app.AntEvenBackCollection, err error)
}

type analysis struct {
	analysisStore store.AnalysisStore
}

// 查询事件
func (a *analysis) QueryEvent(etype, action, from string, page int, count int) (result app.AntEventHistoryList, err error) {
	return a.analysisStore.QueryEvent(etype, action, from, page, count)
}

// 查询事件监听执行情况
func (a *analysis) QueryHook(eid string) (result app.AntEvenBackCollection, err error) {
	return a.analysisStore.QueryHook(eid)
}
